﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true"
    CodeBehind="ListarModulos.aspx.cs" Inherits="Web.ListarModulos" %>

<%@ Register Src="~/UserControls/ucMensagem.ascx" TagName="UserControl" TagPrefix="ucM" %>
<%@ Register Src="~/UserControls/ucCabecalho.ascx" TagName="UserControl" TagPrefix="ucC" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
    <ucC:UserControl ID="ucCabecalho" runat="server"></ucC:UserControl>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <center>
        <ucM:UserControl ID="ucMensagem" runat="server"></ucM:UserControl>
        <!--Filtro-->
        <asp:Panel ID="pnlFiltro" runat="server" BorderWidth="1px" Width="307" CssClass="painelFiltro">
            <div align="left">
                <asp:Label ID="lblNome" runat="server" Text="NOME: " CssClass="label"></asp:Label>
                <asp:TextBox ID="txtNome" runat="server" Width="300px" MaxLength="50"></asp:TextBox>
                <br />
                <asp:Label ID="lblStatus" runat="server" Text="STATUS: " CssClass="label"></asp:Label>
                <asp:RadioButtonList ID="rblStatus" runat="server" RepeatDirection="Horizontal">
                </asp:RadioButtonList>
                <br />
             </div>
             <div align="right">
                <asp:Button ID="btnPesquisar" runat="server" Text="PESQUISAR" CssClass="button" 
                     OnClick="btnPesquisar_Click" />
             </div>
        </asp:Panel>
        <!--FIM Filtro-->
        <br />
        <!--Cabeçalho da tabela-->
        <table>
            <tr>
                <td style="width: 120px">
                    <asp:Label ID="Label3" runat="server" Text="STATUS" CssClass="cabecalhoLista"></asp:Label>
                </td>
                <td style="width: 40px">
                    <asp:Label ID="lblId" runat="server" Text="ID" CssClass="cabecalhoLista"></asp:Label>
                </td>
                <td style="width: 200px">
                    <asp:Label ID="Label2" runat="server" Text="NOME" CssClass="cabecalhoLista"></asp:Label>
                </td>
                <td style="width: 300px">
                    <asp:Label ID="Label1" runat="server" Text="DESCRIÇÃO" CssClass="cabecalhoLista"></asp:Label>
                </td>
                <td style="width: 100px">
                    <asp:Label ID="Label5" runat="server" Text="VALOR" CssClass="cabecalhoLista"></asp:Label>
                </td>
                <td style="width: 100px">
                    <asp:Label ID="Label4" runat="server" Text="OPÇÕES" CssClass="cabecalhoLista"></asp:Label>
                </td>
            </tr>
        </table>
        <!--FIM Cabeçalho da tabela-->
         <!--Corpo da tabela-->
        <asp:ListView ID="ltvModulo" runat="server" InsertItemPosition="FirstItem" 
            OnItemCanceling="ltvModulo_ItemCanceling" 
            OnItemDataBound="ltvModulo_ItemDataBound" 
            OnItemDeleting="ltvModulo_ItemDeleting" OnItemEditing="ltvModulo_ItemEditing" 
            OnItemInserting="ltvModulo_ItemInserting" 
            OnItemUpdating="ltvModulo_ItemUpdating" >
            <EmptyDataTemplate>
                <br />
                <b>Nenhum Módulo disponível.</b>
                <br />
                <br />
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <table id="itemPlaceholder" runat="server" class="listView">
                    <tr>
                        <td style="width: 150px">
                            <asp:RadioButtonList ID="rblStatus" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="True" Selected="True"><img src="../../Images/iconAtivo.png" /></asp:ListItem>
                                <asp:ListItem Value="False"><img src="../../Images/iconInativo.png" /></asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                        <td style="width: 40px" align="center">
                            <asp:Label ID="lblId" runat="server" Text="0"></asp:Label>
                        </td>
                        <td style="width: 200px">
                            <asp:TextBox ID="txtNome" runat="server" Text="" Width="190" MaxLength="50"></asp:TextBox>
                        </td>
                        <td style="width: 300px">
                            <asp:TextBox ID="txtDescricao" runat="server" Text="" Width="290" Height="60" TextMode="MultiLine" MaxLength="500"></asp:TextBox>
                        </td>
                        <td style="width: 100px">
                            <asp:TextBox ID="txtValor" runat="server" Text="0" Width="95" MaxLength="15"></asp:TextBox>
                        </td>
                        <td style="width: 100px" align="center">
                            <asp:ImageButton ID="btiSalvar" runat="server" ImageUrl="~/Images/iconSalvar.png" ToolTip="Salvar" CommandName="Insert"></asp:ImageButton>
                            <asp:ImageButton ID="btiCancelar" runat="server" ImageUrl="~/Images/iconCancelar.png" ToolTip="Cancelar" CommandName="Cancel"></asp:ImageButton>
                        </td>
                    </tr>
                </table>
            </InsertItemTemplate>
            <ItemTemplate>
                <table id="itemPlaceholder" runat="server" class="listView">
                    <tr>
                        <td style="width: 150px" align="center">
                            <asp:Label ID="lblStatus" runat="server" Visible="false" Text='<%# Eval("Status") %>'/>
                            <asp:Image ID="imgStatus" runat="server"/>
                        </td>
                        <td style="width: 40px" align="center">
                            <asp:Label ID="lblId" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                        </td>
                        <td style="width: 200px">
                            <asp:Label ID="lblNome" runat="server" Text='<%# Eval("Nome") %>'></asp:Label>
                        </td>
                        <td style="width: 300px">
                            <asp:Label ID="lblDescricao" runat="server" Text='<%# Eval("Descricao") %>'></asp:Label>
                        </td>
                        <td style="width: 100px">
                            <asp:Label ID="lblValor" runat="server" Text='<%# Eval("Valor") %>'></asp:Label>
                        </td>
                        <td style="width: 100px" align="center">
                            <asp:ImageButton ID="btiEditar" runat="server" ImageUrl="~/Images/iconEditar.png" ToolTip="Editar" CommandName="Edit"></asp:ImageButton>
                            <asp:ImageButton ID="btiConfigurar" runat="server" ImageUrl="~/Images/iconConfigurar.png" ToolTip="Configurar" CommandArgument='<%# Eval("Id") %>' OnClick="btiConfigurar_Click"></asp:ImageButton>
                            <asp:ImageButton ID="btiExcluir" runat="server" ImageUrl="~/Images/iconExcluir.png" ToolTip="Excluir" CommandName="Delete" OnClientClick="confirm('Você deseja realmente excluir este Grupo?');"></asp:ImageButton>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
            <EditItemTemplate>
                <table id="itemPlaceholder" runat="server" class="listView">
                    <tr>
                        <td style="width: 150px">
                            <asp:RadioButtonList ID="rblStatus" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Value="True" Selected="True"><img src="../../Images/iconAtivo.png" /></asp:ListItem>
                                <asp:ListItem Value="False"><img src="../../Images/iconInativo.png" /></asp:ListItem>
                            </asp:RadioButtonList>
                            <asp:Label ID="lblStatus" runat="server" Visible="false" Text='<%# Eval("Status") %>'/>
                        </td>
                        <td style="width: 40px" align="center">
                            <asp:Label ID="lblId" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                        </td>
                        <td style="width: 200px">
                            <asp:TextBox ID="txtNome" runat="server" Text='<%# Eval("Nome") %>' Width="190" MaxLength="50"></asp:TextBox>
                        </td>
                        <td style="width: 300px">
                            <asp:TextBox ID="txtDescricao" runat="server" Text='<%# Eval("Descricao") %>' Width="290" Height="60" TextMode="MultiLine" MaxLength="500"></asp:TextBox>
                        </td>
                        <td style="width: 100px">
                            <asp:TextBox ID="txtValor" runat="server" Text='<%# Eval("Valor") %>' Width="95" MaxLength="15"></asp:TextBox>
                        </td>
                        <td style="width: 100px" align="center">
                            <asp:ImageButton ID="btiSalvar" runat="server" ImageUrl="~/Images/iconSalvar.png" ToolTip="Salvar" CommandName="Update"></asp:ImageButton>
                            <asp:ImageButton ID="btiCancelar" runat="server" ImageUrl="~/Images/iconCancelar.png" ToolTip="Cancelar" CommandName="Cancel"></asp:ImageButton>
                        </td>
                    </tr>
                </table>
            </EditItemTemplate>  
        </asp:ListView>
        <!--FIM Corpo da tabela-->
    </center>
</asp:Content>
